FUNCTION DAC_BitsToByte :BYTE
TITLE = 'DAC_BitsToByte'
//
// This functionblock convert the 8 input bits to byte
//
// Versionshistory:
// 1.0 Ersterstellung E.Dittmann

VERSION : '1.0'
AUTHOR  : 'Lenze'
FAMILY  : 'DAC'
NAME : 'bitToby'
KNOW_HOW_PROTECT

VAR_INPUT
    xBit0:                  BOOL;
    xBit1:                  BOOL;
    xBit2:                  BOOL;
    xBit3:                  BOOL;
    xBit4:                  BOOL;
    xBit5:                  BOOL;
    xBit6:                  BOOL;
    xBit7:                  BOOL;   
END_VAR

VAR
    byOut:                  BYTE;
    xbyOut AT byOut:        ARRAY[0..7] OF BOOL;

END_VAR

        
BEGIN
    xbyOut[0] := xBit0;
    xbyOut[1] := xBit1;
    xbyOut[2] := xBit2;
    xbyOut[3] := xBit3;
    xbyOut[4] := xBit4;
    xbyOut[5] := xBit5;
    xbyOut[6] := xBit6;
    xbyOut[7] := xBit7;
    
    DAC_BitsToByte := byOut;
     
END_FUNCTION



